package com.briup.jdk8;

import java.io.Serializable;
import java.util.stream.Stream;

/**
 * Stream 静态方法  使用
 */
public class StreamStaticMethodDemo {
    public static void main(String[] args) {
        Stream<Integer> stream1 = Stream.of(1, 2, 3);
        Stream<String> stream2 = Stream.of("1", "2", "3");
        Stream<? extends Object> concat = Stream.concat(stream1, stream2);
        concat.forEach(System.out::println);
         Stream.generate(() -> 2)
                .limit(10)
                .map(i->Double.valueOf(Math.random()*10))
                .forEach(System.out::println);

         Stream.iterate(0,i->i+3).limit(10).forEach(System.out::println);
    }
}
